package com.burstly.lib.component.networkcomponent.burstly.html;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Handler;
import android.webkit.WebView;
import com.burstly.lib.component.networkcomponent.IActivityLifeCycleAware;
import com.burstly.lib.component.networkcomponent.burstly.FullscreenOverlayContainer;
import com.burstly.lib.constants.Constants;
import com.burstly.lib.util.LoggerExt;
import com.burstly.lib.util.UiSafeWebView;

public class ScriptInterstitialOverlay<T extends UiSafeWebView,  extends IActivityLifeCycleAware> extends FullscreenOverlayContainer<T>
  implements IJsBridge
{
  public ScriptInterstitialOverlay(T paramT)
  {
    super(paramT, "burstlyScript");
    paramT.addJavascriptInterface(this, "ScriptActivity");
  }

  public void closeActivity()
  {
    this.mHandler.post(this);
  }

  public void getSdkVersion()
  {
    ((UiSafeWebView)getChildView()).loadUrl("javascript: if (window.burstlySdkVersion != null) window.burstlySdkVersion('" + Constants.SDK_VERSION + "')");
  }

  public void hideOverlayed()
  {
    ((UiSafeWebView)getChildView()).setHostingOverlay(null);
    super.hideOverlayed();
  }

  public void openExternalURL(String paramString)
  {
    if (paramString != null)
      try
      {
        Intent localIntent = new Intent("android.intent.action.VIEW", Uri.parse(paramString));
        getContext().startActivity(localIntent);
        return;
      }
      catch (Exception localException)
      {
        LOG.logError(TAG, localException.getMessage(), new Object[0]);
        return;
      }
    LOG.logInfo(TAG, "External url to open is NULL", new Object[0]);
  }

  public void showOverlayed()
  {
    ((UiSafeWebView)getChildView()).setHostingOverlay(this);
    super.showOverlayed();
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.component.networkcomponent.burstly.html.ScriptInterstitialOverlay
 * JD-Core Version:    0.6.2
 */